﻿@{
    ViewBag.Title = "Retailer Maintenance";
    LineFocus.Nikcron.Models.Lookup Companies = ViewBag.Companies;
    LineFocus.Nikcron.Models.Lookup States = ViewBag.States;
    LineFocus.Nikcron.Models.Lookup Countries = ViewBag.Countries;
    LineFocus.Nikcron.Models.Lookup Stockhouses = ViewBag.Stockhouses;
    LineFocus.Nikcron.Models.Lookup Distributors = ViewBag.Distributors;
    LineFocus.Nikcron.Models.Lookup Dealers = ViewBag.Dealers;
}

@model Nickron.Database.Retailer

@using (Html.BeginForm("Maintenance", "Retailer", FormMethod.Post, new { onsubmit = "return ValidateForm();", enctype = "multipart/form-data" }))
{
    <div class="col-md-6">

        <div class="box box-danger">
            <div class="box-body">

                <div class="form-group">
                    <label> Company:</label><span class="astrisk">*</span>
                    <div class="input-group" style="width:100%;">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <select id="Company" name="Company" class="selectpicker" title="Select Company">
                            @Html.Partial("Dropdown", Companies)
                        </select>
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> Stockhouse:</label><span class="astrisk">*</span>
                    <div class="input-group" style="width:100%;">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <select id="Stockhouse" name="Stockhouse" class="selectpicker show-tick" data-hide-disabled="true" title="Select Stockhouse">
                            @Html.Partial("Dropdown", Stockhouses)
                        </select>
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> Distributors:</label><span class="astrisk">*</span>
                    <div class="input-group" style="width:100%;">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <select id="Distributor" name="Distributor" class="selectpicker show-tick" data-hide-disabled="true" title="Select Distributor">
                            @Html.Partial("Dropdown", Distributors)
                        </select>
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> Dealers:</label><span class="astrisk">*</span>
                    <div class="input-group" style="width:100%;">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <select id="Dealer" name="Dealer" class="selectpicker show-tick" data-hide-disabled="true" title="Select Dealer">
                            @Html.Partial("Dropdown", Dealers)
                        </select>
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> Location/Town:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Location" name="Location" class="form-control">
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> Retailer Name:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i class=""></i>
                        </div>
                        <input id="Retailer" name="Retailer" maxlength="250" type="text" class="form-control" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> Contact Person Name:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i class=""></i>
                        </div>
                        <input id="ContactPerson" name="ContactPerson" maxlength="250" type="text" class="form-control" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> Registration Date:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i class="fa fa-calendar"></i>
                        </div>
                        <input type="text" id="JoinDate" name="JoinDate" class="form-control bfh-datepicker" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> Name of the firm:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i class=""></i>
                        </div>
                        <input id="NameOfthefirm" name="NameOfthefirm" maxlength="250" type="text" class="form-control" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> Address Line 1:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i class=""></i>
                        </div>
                        <input id="Address1" name="Address1" maxlength="500" class="form-control">
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> Address Line 2:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i class=""></i>
                        </div>
                        <input id="Address2" name="Address2" maxlength="500" class="form-control">
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> City:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i class=""></i>
                        </div>
                        <input id="City" name="City" maxlength="250" type="text" class="form-control" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> Zip:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i class=""></i>
                        </div>
                        <input id="Zip" name="Zip" type="text" maxlength="6" class="form-control" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> State:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <select id="State" name="State" class="selectpicker" title="Select State">
                            @Html.Partial("SelectList", States)
                        </select>
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> Country:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <select id="Country" name="Country" class="selectpicker" title="Select Country">
                            @Html.Partial("SelectList", Countries)
                        </select>
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> Mobile Number 1:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i class=""></i>
                        </div>
                        <input id="Mobile1" name="Mobile1" type="number" maxlength="10" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> Mobile Number 2:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i class=""></i>
                        </div>
                        <input id="Mobile2" name="Mobile2" type="number" maxlength="10" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> Phone Number :</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Phone" name="Phone" type="number" maxlength="11" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> Email ID1:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Email1" name="Email1" type="text" maxlength="500" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> Email ID2:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Email2" name="Email2" type="text" maxlength="500" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> Website:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Website" name="Website" type="text" maxlength="40" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->
            </div><!-- /.box-body -->
        </div><!-- /.box -->
    </div><!-- /.col (left) -->

    <div class="col-md-6">
        <div class="box box-primary">

            <div class="box-body">

                <div class="form-group">
                    <label> PAN No:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Panno" name="Panno" maxlength="20" type="text" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> TIN No:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Tinno" name="Tinno" maxlength="20" type="text" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> CST No:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="CSTno" name="CSTno" maxlength="250" type="text" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> ID Proff:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Idproff" name="Idproff" maxlength="250" type="text" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> Communication Address:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="CommunicationAddress" name="CommunicationAddress" maxlength="500" type="text" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> Current Business:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="CurrentBusiness" name="CurrentBusiness" maxlength="20" type="text" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> Name of the Bank/branch:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="NameOfBank" name="NameOfBank" maxlength="20" type="text" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> Bank AC No:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="BankAcNo" name="BankAcNo" maxlength="25" type="text" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> IFSC Code:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="IFSCCode" name="IFSCCode" maxlength="25" type="text" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> Business covered Area:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="BusinesscoveredArea" name="BusinesscoveredArea" maxlength="500" type="text" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> Man Power:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input name="ManPower" id="ManPower" value="10" min="0" max="999" type="text" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> Peak Sales Period:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input name="PeakSalesPeriod1" id="PeakSalesPeriod1" maxlength="50" type="text" class="form-control pull-right" />
                    </div><!-- /.input group -->

                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>

                    </div><!-- /.input group -->

                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input name="PeakSalesPeriod2" id="PeakSalesPeriod2" maxlength="50" type="text" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> Popular Festivals Fairs:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Popularfestivals" name="Popularfestivals" maxlength="100" type="text" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> Uplode PDF File:</label>
                    <a id="pdfLink" href="#" target="_blank"></a>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Pdfupload" name="Pdfupload" type="file" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>Recommended By:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i class=""></i>
                        </div>
                        <input id="RecommendedBy" name="RecommendedBy" maxlength="250" type="text" class="form-control" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> Comments:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Comments" name="Comments" maxlength="500" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> User Name:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Username" name="Username" maxlength="20" type="text" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label> Password:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Password" name="Password" maxlength="20" type="text" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    @*<div class="checkbox">
                            <label>
                                <input type="checkbox" id="checkStatus" />
                                Status
                            </label>
                        </div>*@
                </div><!-- /.form group -->

            </div><!-- /.box-body -->
        </div><!-- /.box -->

        <div class="box box-success">
            <div class="box-footer">
                <input type="hidden" name="Id" id="Id" value="@ViewBag.Id" />
                <button type="submit" class="btn btn-primary" style=" width:80px;">Save</button>
                <button type="reset" class="btn btn-primary" style=" width:80px;">Cancel</button>
            </div>
        </div><!-- /.box -->
    </div><!-- /.col (right) -->
}

<script type="text/javascript">

    function ValidateForm() {

        RequiredDropdown("Dealer", -1, "Select a Dealer");
        RequiredTextbox("Location", "Enter the Localtion/Town Name");
        RequiredTextbox("Retailer", "Enter the Retailer Name");
        RequiredTextbox("ContactPerson", "Enter the Contact Person");
        RequiredTextbox("JoinDate", "Select Registration Date");
        RequiredTextbox("NameOfthefirm", "Enter The Name Of the firm");
        RequiredTextbox("Address1", "Enter the Address1");
        RequiredTextbox("Address2", "Enter the Address2");
        RequiredTextbox("City", "Enter the City");
        RequiredTextbox("Zip", "Enter the Zip");
        RequiredDropdown("State", -1, "Select a State");
        RequiredDropdown("Country", -1, "Select a Country");
        ValidateZip("Zip", "Enter Valid Zip");
        RequiredTextbox("Mobile1", "Enter the Mobilenumber1");
        ValidateMobilenumber("Mobile1", "Mobilenumber 1 - Enter Valid Number");
        ValidateMobilenumber("Mobile2", "Mobilenumber 2 - Enter Valid Number");
        ValidatePhonenumber("Phone", "Enter Valid Phone Number");
        RequiredTextbox("Email1", "Enter Valid Email Id");
        ValidateEmailaddress("Email1", "Email1 - Enter Valid Email Id");
        ValidateEmailaddress("Email2", "Email2 - Enter Valid Email Id");
        ValidNumber("ManPower", "Man Power - Enter valid number");
        if ("@ViewBag.Id" == "") {
            RequiredTextbox("Username", "Enter the Username");
            RequiredTextbox("Password", "Enter the Password");
            ValidMinLength("Username", 6, "Username must be minimum 6 characters");
            ValidMinLength("Password", 6, "Password must be minimum 6 characters");
        }
        return AlertError();
    }

    $('#Company').change(function () {
        $('.Company').removeAttr("disabled");
        $('.Company').prop("disabled", "true");
        $('.Company_' + $('#Company').val()).removeAttr("disabled");
        $('#Stockhouse').removeAttr("disabled");
        $('#Stockhouse').selectpicker('deselectAll');
        $('#Stockhouse').selectpicker("render");
        $('#Stockhouse').selectpicker("refresh");
        $('#Stockhouse')[0].selectedIndex = -1;
        $('*[data-id="Stockhouse"]').prop("title", "");
        $('*[data-id="Stockhouse"]').html('<span class="filter-option pull-left" />&nbsp;<span class="caret" />');
    });

    $('#Stockhouse').change(function () {
        $('.Stockhouse').removeAttr("disabled");
        $('.Stockhouse').prop("disabled", "true");
        $('.Stockhouse_' + $('#Stockhouse').val()).removeAttr("disabled");
        $('#Distributor').removeAttr("disabled");
        $('#Distributor').selectpicker('deselectAll');
        $('#Distributor').selectpicker("render");
        $('#Distributor').selectpicker("refresh");
        $('#Distributor')[0].selectedIndex = -1;
        $('*[data-id="Distributor"]').prop("title", "");
        $('*[data-id="Distributor"]').html('<span class="filter-option pull-left" />&nbsp;<span class="caret" />');
    });

    $('#Distributor').change(function () {
        $('.Distributor').removeAttr("disabled");
        $('.Distributor').prop("disabled", "true");
        $('.Distributor_' + $('#Distributor').val()).removeAttr("disabled");
        $('#Dealer').removeAttr("disabled");
        $('#Dealer').selectpicker('deselectAll');
        $('#Dealer').selectpicker("render");
        $('#Dealer').selectpicker("refresh");
        $('#Dealer')[0].selectedIndex = -1;
        $('*[data-id="Dealer"]').prop("title", "");
        $('*[data-id="Dealer"]').html('<span class="filter-option pull-left" />&nbsp;<span class="caret" />');
    });

    function AutoCompleteCity() {
        $("#City").autocomplete({
            source: function (request, response) {
                var cities = new Array();
                $.ajax({
                    async: false,
                    cache: false,
                    type: "POST",
                    url: "@Url.Action("GetCities", "Master")",
                    data: { "Name": request.term },
                    success: function (data) {
                        for (var i = 0; i < data.length ; i++) {
                            cities[i] = { label: data[i].Name, Id: data[i].Id };
                        }
                    }
                });
                response(cities);
            },
            select: function (event, ui) {
                $.ajax({
                    cache: false,
                    async: false,
                    type: "POST",
                    url: "@(Url.Action("GetStateCountry", "Master"))",
                    data: { "CityId": ui.item.Id },
                    success: function (data) {
                        $('select#State').selectpicker("val", data[0].StateName);
                        $('select#Country').selectpicker("val", data[0].CountryName);
                    },
                    error: function (xhr, ajaxOptions, thrownError) {
                    }
                });
            }
        });
    }

    $(document).ready(function () {

        $('.selectpicker').selectpicker();
        $('#JoinDate').datepicker();
        $('#PeakSalesPeriod1').datepicker();
        $('#PeakSalesPeriod2').datepicker();
        AutoCompleteCity();

        if ("@ViewBag.Id" != "") {

            $('#Company').selectpicker("val", "@Model.Dealer.Distributor.Stockhouse.CompanyId");
            $('#Stockhouse').selectpicker("val", "@Model.Dealer.Distributor.Stockhouse.Id");
            $('#Distributor').selectpicker("val", "@Model.Dealer.Distributor.Id");
            $('#Dealer').selectpicker("val", "@Model.Dealer.Id");
            $('#Location').val("@Model.Location");
            $('#Retailer').val("@Model.Name");
            $('#ContactPerson').val("@Model.ContactPerson");
            $('#JoinDate').val('@Model.JoiningDate'); //.substring(0,6)
            $('#NameOfthefirm').val("@Model.FirmRegistration");
            $('#Address1').val("@Model.Address.Address1");
            $('#Address2').val("@Model.Address.Address2");
            $('#City').val("@Model.Address.City");
            $('#Zip').val("@Model.Address.Zip");
            $('#State').selectpicker("text", "@Model.Address.State");
            $('#Country').selectpicker("text", "@Model.Address.Country");
            $('#Mobile1').val("@Model.Contact1.Mobile");
            $('#Mobile2').val("@Model.Contact2.Mobile")
            $('#Phone').val("@Model.Contact1.Phone")
            $('#Email1').val("@Model.Contact1.Email");
            $('#Email2').val("@Model.Contact2.Email");
            $('#Website').val("@Model.Contact1.Website");
            $('#Panno').val('@Model.PAN');
            $('#Tinno').val('@Model.TIN');
            $('#CSTno').val('@Model.CST');
            $('#Idproff').val('@Model.IDProof');
            $('#CommunicationAddress').val('@Model.BusinessPresentAddress');
            $('#CurrentBusiness').val('@Model.CurrentBusiness');
            $('#NameOfBank').val('@Model.BankName');
            $('#BankAcNo').val('@Model.BankAccountNumber');
            $('#IFSCCode').val('@Model.BankIFSC');
            $('#BusinesscoveredArea').val('@Model.Coverages');
            $('#ManPower').val("@Model.StrengthOfFieldForce");
            if ("@Model.PeakSalesPeriod" != "") {
                var peakSalesPeriods = "@Model.PeakSalesPeriod".split(" To ");
                $('#PeakSalesPeriod1').val(peakSalesPeriods[0]);
                $('#PeakSalesPeriod2').val(peakSalesPeriods[1]);
            }
            if ('@Model.UploadedFile' != '') {
                $('#pdfLink').prop("href", '@Url.Content("~/Uploads/" + Model.UploadedFile)');
                $('#pdfLink').text("Uploaded PDF File")
            }
            $('#Popularfestivals').val("@Model.PopularFestivalFairs");
            $('#Recommendedby').val('@Model.RecommendationFrom');
            $('#Comments').val("@Model.Comments");
            $('#Company').prop("disabled", "true");
            $('#Stockhouse').prop("disabled", "true");
            $('#Distributor').prop("disabled", "true");
            $('#Dealer').prop("disabled", "true");
            
            $(".selectpicker").selectpicker("refresh");
            $('.form-group:contains("User Name")').closest("div").hide();
            $('.form-group:contains("Password")').closest("div").hide();
        }
        else {
            $('#Company')[0].selectedIndex = -1;
            $('*[data-id="Company"]').prop("title", "");
            $('*[data-id="Company"]').html('<span class="filter-option pull-left" />&nbsp;<span class="caret" />');

            $('#Stockhouse')[0].selectedIndex = -1;
            $('*[data-id="Stockhouse"]').prop("title", "");
            $('*[data-id="Stockhouse"]').html('<span class="filter-option pull-left" />&nbsp;<span class="caret" />');

            $('#Distributor')[0].selectedIndex = -1;
            $('*[data-id="Distributor"]').prop("title", "");
            $('*[data-id="Distributor"]').html('<span class="filter-option pull-left" />&nbsp;<span class="caret" />');

            $('#Dealer')[0].selectedIndex = -1;
            $('*[data-id="Dealer"]').prop("title", "");
            $('*[data-id="Dealer"]').html('<span class="filter-option pull-left" />&nbsp;<span class="caret" />');
        }
    });
</script>

